<?php
namespace Profiles\Model;

use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql;
use Zend\Db\Sql\Where;
use Zend\Db\Sql\Select;
use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Paginator;
use Zend\Db\Sql\Predicate;
use Zend\Db\Sql\Expression;

class CommentTable
{
    protected $tableGateway;
	protected $insert;
	protected $select;
	protected $update;
	protected $delete;
	protected $where;
	protected $resultSet;
    public function __construct(TableGateway $tableGateway)
    {
        $this->tableGateway = $tableGateway;
		$this->select = new Select();
    }
	public function addCommnet($data)
	{ 
		if(isset($_SESSION['user']['user_id']) && $_SESSION['user']['user_id']!=""){
			$user_id=$_SESSION['user']['user_id'];
		}else{
			$user_id='';
		}
			$data = array(
				'comment'             => $data['comment'],
				'added_date'          => date('Y-m-d H:i:s'),
				'upadted_date'        => date('Y-m-d H:i:s'),
				'comment_status'      => 1, 
				'user_id'             => $user_id, 
			);
			$result=$this->tableGateway->insert($data);
			return $result;                   
	}	
}